# Generated manually for Department model and College department field

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0002_college_remove_userprofile_college_name_and_more'),
    ]

    operations = [
        # 创建Department模型
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(choices=[('engineering', '工学部'), ('science', '理学部'), ('humanities', '文学部'), ('economics', '经济学部'), ('management', '管理学部')], max_length=20, unique=True, verbose_name='学部名称')),
                ('description', models.TextField(blank=True, verbose_name='学部描述')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '学部',
                'verbose_name_plural': '学部',
                'ordering': ['name'],
            },
        ),
        # 为College添加department字段（允许为空，稍后填充数据）
        migrations.AddField(
            model_name='college',
            name='department',
            field=models.ForeignKey(blank=True, null=True, help_text='学院所属的学部', on_delete=django.db.models.deletion.CASCADE, to='accounts.department', verbose_name='所属学部'),
        ),
    ]